package com.polly.esphwevent.controller;

import com.polly.esphwevent.common.exceptions.ServiceException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author liqin@nd.com.cn
 * @version V1.0
 * @title: AdviceController
 * @description: TODO(用一句话描述该文件做什么)
 * @date: 2019/2/26 19:28
 */
@RestController
public class AdviceController {

    @RequestMapping(value = "/publish1",method = RequestMethod.GET)
    public String hello1() {
        int i = 1 / 0;
        return "hello";
    }

    @RequestMapping(value = "/respondence2", method = RequestMethod.GET)
    public String hello2(Long id) {
        String string = null;
        string.length();
        return "hello";
    }

    @RequestMapping(value = "/comment3", method = RequestMethod.GET)
    public List<String> hello3() {
        throw new ServiceException(8001,"test");
    }

}
